<template>
	<view class="rich-text-container">
		<!-- <u-navbar :is-back="true" :title="pageTitle"></u-navbar> -->
		<view class="content-wrapper">
			<u-parse :html="htmlContent" :tag-style="tagStyle"></u-parse>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			pageTitle: '',
			htmlContent: '',
			tagStyle: {
				p: 'line-height: 1.8; margin-bottom: 1em;',
				img: 'max-width: 100%; height: auto;'
			}
		};
	},
	onLoad(options) {
		if (options.title) {
			this.pageTitle = decodeURIComponent(options.title);
		}
		if (options.content) {
			this.htmlContent = decodeURIComponent(options.content);
		} else {
			this.htmlContent = '<p style="text-align: center; color: #999;">没有需要显示的内容</p>';
		}
	}
};
</script>

<style lang="scss">
.rich-text-container {
	background-color: #fff;
	min-height: 100vh;
}
.content-wrapper {
	padding: 30rpx;
}
</style> 